package cn.hss.loop;

import java.util.Scanner;

/**return语句
 * @author 作者：HeShaoShuai
 * @Email 邮箱：2569819541@qq.com
 * @Date 日期：2023/4/25 16:43
 * @Package 包名：cn.hss.loop
 * @Project 项目名：JavaSE
 * @Version 1.0
 */
public class ReturnExample {
	public static void main(String[] args) {
		Scanner sca = new Scanner(System.in);
		System.out.println("请输入操作数1：");
		double num1 = sca.nextDouble();
		System.out.println("请输入操作数2：");
		double num2 = sca.nextDouble();
		double d = sumNumber(num1, num2);
		System.out.println(num1+"+"+num2+"="+d);
	}
	//创建方法用于计算两个数的和，返回值为double类型
	public static double sumNumber(double n1,double n2){
		double sum=n1+n2;
		return sum;
	}
}
